Composition of Transformations

Introduction

When we apply a geometric or algebraic transformation—like a rotation, reflection, scaling, or shear—we often want to apply more than one in a row.
Matrix multiplication gives us a compact way to combine these steps into a single transformation.

This article explains how and why multiple transformations can be composed using matrices, and how to compute and interpret the results.

Why Compose Transformations?

Some reasons we combine transformations:

A sequence like:

can be replaced by one matrix that does all three at once.

Applying Transformations Step-by-Step

Suppose you have a vector $v$ and two transformations:

The process is:

  1. Compute $A v$
  2. Then compute $B (A v)$

This is often written as: $$v' = B A v$$ Key points:

Matrix Multiplication as Composition

When you multiply matrices, you are really combining transformations.

If:

Then $BA$ is the transformation that:

  1. scales first
  2. rotates second

This is why the order of multiplication is so important.

A helpful mental model

Think of matrices as machines:

Sending $v$ through both machines in order gives: $$v \xrightarrow{A} A v \xrightarrow{B} B(A v)$$ The combined machine is $BA$.

Examples of Composition

Example 1: Scaling then rotating

Let $$A = \begin{pmatrix} 2 & 0 \\ 0 & 2 \end{pmatrix}, \quad B = \begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix}$$

The combined transformation is: $$BA = \begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix} \begin{pmatrix} 2 & 0 \\ 0 & 2 \end{pmatrix} = \begin{pmatrix} 0 & -2 \\ 2 & 0 \end{pmatrix}$$

Example 2: Reflection then shear

Let $R$ reflect across the $x$-axis and $S$ shear horizontally.
Then $SR$ means:

  1. reflect
  2. shear

But $RS$ means:

  1. shear
  2. reflect

These produce different results—composition is not commutative.

Geometric Interpretation

When composing transformations:

Composition lets us build complex transformations from simple ones.

Exercises

  1. Let
    $A = \begin{pmatrix}2 & 0 \\ 0 & 1\end{pmatrix}$
    and
    $B = \begin{pmatrix}1 & 1 \\ 0 & 1\end{pmatrix}$.
    Compute $BA$.

    Solution

    $$BA = \begin{pmatrix} 1 & 1 \\ 0 & 1 \end{pmatrix} \begin{pmatrix} 2 & 0 \\ 0 & 1 \end{pmatrix} = \begin{pmatrix} 2 & 1 \\ 0 & 1 \end{pmatrix}$$

  2. Apply $A$ then $B$ to the vector $v = (3,1)$ using the same matrices as above.

    Solution

    First compute $A v$: $$A(3,1) = (6,1)$$ Then apply $B$: $$B(6,1) = (7,1)$$

  3. Suppose $R$ is a $90^\circ$ rotation matrix and $S$ is a scaling matrix with factor $3$.
    Write the combined transformation matrix $RS$.

    Solution

    A $90^\circ$ rotation is: $$R = \begin{pmatrix}0 & -1 \\ 1 & 0\end{pmatrix}$$ Scaling by $3$ is: $$S = \begin{pmatrix}3 & 0 \\ 0 & 3\end{pmatrix}$$ Thus: $$RS = \begin{pmatrix} 0 & -3 \\ 3 & 0 \end{pmatrix}$$

  4. True or false: If $A$ and $B$ are both reflections, then $AB$ is always a reflection.

    Solution

    False.
    Two reflections can produce a rotation (for example, reflecting across two lines that meet at an angle).

  5. Let
    $C = \begin{pmatrix}0 & -1 \\ 1 & 0\end{pmatrix}$
    and
    $D = \begin{pmatrix}1 & 0 \\ 0 & -1\end{pmatrix}$.
    Compute $DC$.

    Solution

    $$DC = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix} \begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix} = \begin{pmatrix} 0 & -1 \\ -1 & 0 \end{pmatrix}$$

  6. Describe in words what it means for $BA$ to represent “first apply $A$, then apply $B$.”

    Solution

    $BA$ means:

    • take a vector
    • transform it with $A$
    • then transform the result with $B$

    The matrix closest to the vector acts first.

  7. Compute the composition $$\begin{pmatrix} 1 & 2 \\ 0 & 1 \end{pmatrix} \begin{pmatrix} 3 & 0 \\ 0 & 3 \end{pmatrix}$$

    Solution

    $$\begin{pmatrix} 1 & 2 \\ 0 & 1 \end{pmatrix} \begin{pmatrix} 3 & 0 \\ 0 & 3 \end{pmatrix} = \begin{pmatrix} 3 & 6 \\ 0 & 3 \end{pmatrix}$$